Skip to content

feat(wasm-utxo): per-coin maxFeeRate absurd-fee limits#307

Closed
OttoAllmendinger wants to merge 1 commit into
masterfrom
otto/T1-3656-per-coin-maxfeerate-absurd
Closed

feat(wasm-utxo): per-coin maxFeeRate absurd-fee limits#307
OttoAllmendinger wants to merge 1 commit into
masterfrom
otto/T1-3656-per-coin-maxfeerate-absurd

Conversation

@OttoAllmendinger

Copy link
Copy Markdown
Contributor

Summary

  • Add a per-coin max fee rate policy to wasm-utxo so PSBT extraction can reject absurd-fee transactions without falsely rejecting low-unit-value coins (notably Dogecoin).
  • Dogecoin's default fee rate (~50_000_000 sat/kB on a ~1 vB tx) exceeds rust-bitcoin's DEFAULT_MAX_FEE_RATE (25_000 sat/vB), so the stock absurd-fee guard rejects valid DOGE PSBTs at combine-psbt/extract (HTTP 500 for tdoge sends). Fix by deriving the limit per network.

Changes

  • fees::get_max_fee_rate_sat_per_kb(network): None (Unlimited) for the Dogecoin family, Some(1_000_000_000) for BTC/LTC/ZEC + testnets.
  • FeeRateLimit (Default | Limited | Unlimited) selects extract_tx_with_fee_rate_limit vs. unchecked extract_tx.
  • JS: fees.getMaxFeeRateSatPerKB(coin) + FeesNamespace; BitGoPsbt and ZcashBitGoPsbt .extractTransaction(maxFeeRate?) forward to the wasm extract_transaction / extract_zcash_transaction params.

Test plan

  • Rust unit tests: DOGE high-fee extracts (unlimited), BTC still rejects under default, Infinity → unchecked extract, low finite limit rejects.
  • Downstream: ims-types CombinePsbtRequest.maxFeeRate, ims-utxo forwards request.maxFeeRate, wallet-platform shadow + real combinePsbtExtract pass coin.config.tx.maxFeeRateSatPerKB, and fees.ts delegates to wasm-utxo (separate PRs).

Refs: T1-3656

@linear-code

linear-code Bot commented Jun 29, 2026

Copy link
Copy Markdown

T1-3656

Add a per-coin max fee rate policy so PSBT extraction can reject
absurd-fee transactions without falsely rejecting low-fee coins.

Dogecoin's default fee rate (~50_000_000 sat/kB on a ~1 vB tx) exceeds
Bitcoin's DEFAULT_MAX_FEE_RATE (25_000 sat/vB), so the stock absurd-fee
guard rejects valid DOGE PSBTs. Fix by deriving the limit per network:

- fees::get_max_fee_rate_sat_per_kb(network): None (Unlimited) for the
  Dogecoin family, Some(1_000_000_000) for BTC/LTC/ZEC + testnets.
- FeeRateLimit (Default | Limited | Unlimited) selects
  extract_tx_with_fee_rate_limit vs. unchecked extract_tx.
- JS: fees.getMaxFeeRateSatPerKB(coin) + FeesNamespace; BitGoPsbt and
  ZcashBitGoPsbt .extractTransaction(maxFeeRate?) forward to the wasm
  extract_transaction / extract_zcash_transaction params.

Refs: T1-3656
@OttoAllmendinger OttoAllmendinger force-pushed the otto/T1-3656-per-coin-maxfeerate-absurd branch from 4772c6e to 9f6f7f6 Compare June 29, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant